<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="java.util.List" %>
<%@ page import="demo07.Student" %>
<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: koishi
  Date: 2024/11/5
  Time: 11:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    Student student=new Student("1","koishi","111");
    Student student1=new Student("2","tom","222");
    Student student2=new Student("3","jake","333");
    Student student3=new Student("4","oruse","444");
    List<Student> list=new ArrayList<Student>();
    list.add(student);
    list.add(student1);
    list.add(student2);
    list.add(student3);
    request.setAttribute("list",list);
%>
<table border="1">
    <tr>
        <th>学号</th>
        <th>账号</th>
        <th>密码</th>
    </tr>
    <c:forEach items="${list}" var="item">
        <tr>
            <td>${item.id}</td>
            <td>${item.username}</td>
            <td>${item.password}</td>
        </tr>
    </c:forEach>
</table>
</body>
</html>
